package com.offcn.sellergoods.controller;

import com.offcn.entity.Result;
import com.offcn.entity.StatusCode;
import com.offcn.sellergoods.pojo.Brand;
import com.offcn.sellergoods.service.BrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin  // http  支持跨域  支持所有外部请求来方法当前类中的方法
@RequestMapping("/brand")
@Api("BrandController")
public class BrandController {

    @Autowired
    private BrandService brandService;

    @ApiOperation(value = "查询品牌下拉框数据",tags = {"BrandController"})
    @GetMapping("/selectBrands")
    public Result selectBrands(){
        return new Result(true,StatusCode.OK,"查询成功",brandService.selectBrands());
    }
}
